package com.edu.test;

import com.edu.bean.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/*
 * @Author:mx
 * @Date:2025/11/3-9:27:16
 */
public class MyTest02 {

    /*
    *   使用 SpEl表达式 简化 Spring的配置
    *
    * */
    @Test
    public void test01(){
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("spring-ioc2.xml");
        User user = ctx.getBean(User.class);
        System.out.println(user);
//        Object user2 = ctx.getBean("u1");
//        System.out.println(user == user2);
        ctx.close();

    }
}
